package com.jfast.framework.ioc;

import java.io.Serializable;

import com.jfast.framework.web.core.JfastConstant.BeanScope;

/**
 * 类功能说明:一个bean对象的描述
 * @author zengjintao
 * @version 1.0
 * @createTime 2018年1月5日下午8:31:58
 */
public class BeanInfo implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Class<?> beanClass;
	
	private BeanScope beanScope;
	
	private String beanName;
	
	private Object beanInstance;
	
	public BeanInfo(String beanName,Class<?> beanClass,Object beanInstance){
		this.beanClass = beanClass;
		this.beanName = beanName;
		this.beanScope = BeanScope.SINGLETON;
		this.beanInstance = beanInstance;
	}
	
	public BeanInfo(String beanName,Class<?> beanClass,Object beanInstance,BeanScope beanScope){
		this.beanClass = beanClass;
		this.beanName = beanName;
		this.beanScope = beanScope;
		this.beanInstance = beanInstance;
	}

	public Class<?> getBeanClass() {
		return beanClass;
	}

	public void setBeanClass(Class<?> beanClass) {
		this.beanClass = beanClass;
	}

	public BeanScope getBeanScope() {
		return beanScope;
	}

	public void setBeanScope(BeanScope beanScope) {
		this.beanScope = beanScope;
	}

	public String getBeanName() {
		return beanName;
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public Object getBeanInstance() {
		return beanInstance;
	}

	public void setBeanInstance(Object beanInstance) {
		this.beanInstance = beanInstance;
	}
	
	@Override
	public String toString() {
		return "BeanInfo {" +
                "beanClass='" + this.beanClass + '\'' +
                ", beanName='" + this.beanName + '\'' +
                ", beanScope=" + this.beanScope +
                ", beanInstance='" + this.beanInstance + '\'' +
                '}';
	}
}
